package com.googlecode.ozonbooksfinder.util
{
	import mx.collections.ArrayCollection;
	
	[Bindable]
	public class ListElement
	{
		public var type:String;
		public var descriiption:String;
		
		public function ListElement (type:String = null, 
									descriiption:String = null)
		{
			if (type)
			{
				this.type = type;
			}
			if (descriiption)
			{
				this.descriiption = descriiption;
			}
		}
		
		public static function getDescription (type:String, 
							elements:ArrayCollection):ListElement
		{
			var result:ListElement;
			for each (var element:ListElement in elements)
			{
				if (element.type == type)
				{
					result = element;
					break;
				}
			}
			return result;
		}
	}
}